﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>uuuuuuuu</title>
    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />
    <link href="/Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="/Scripts/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .l-topmenu { height: 40px; border-bottom: 1px solid #ccc; }
        .l-topmenu-welcome { position: absolute; top: 0px; right: 20px; line-height: 24px; }
    </style>
    <script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
</head>
<body style="overflow: hidden;">
    <div id="pageloading" style="display: block;">
    </div>
    <div id="topmenu" class="l-topmenu">
        <div class="l-topmenu-logo">
            EAM</div>
        <div class="l-topmenu-welcome">
            <span class="l-topmenu-username">@ViewBag.UserName</span> &nbsp; 欢迎您 &nbsp; [<a href="javascript:f_changepassword()">修改密码</a>] &nbsp; [<a href="/home/logout">退出</a>]
        </div>
    </div>
    <div id="mainbody" class="l-mainbody" style="width: 99.2%; margin: 0 auto; margin-top: 3px;">
        <div position="left" title="系统菜单" id="mainmenu">
            <ul id="maintree" class="menulist">
            </ul>
        </div>
        <div position="center" id="framecenter">
            <div tabid="home" title="我的主页">
                i am doublesun
            </div>
        </div>
    </div>
    <script type="text/javascript">
        //几个布局的对象
        var layout, tab, accordion;
        //tabid计数器，保证tabid不会重复
        var tabidcounter = 0;
        //窗口改变时的处理函数
        function f_heightChanged(options) {
            if (tab)
                tab.addHeight(options.diff);
            if (accordion && options.middleHeight - 24 > 0)
                accordion.setHeight(options.middleHeight - 24);
        }
        //增加tab项的函数
        function f_addTab(tabid, text, url) {
            if (!tab) return;
            if (!tabid) {
                tabidcounter++;
                tabid = "tabid" + tabidcounter;
            }
            tab.addTabItem({ tabid: tabid, text: text, url: url });
        }

        //修改密码
        function f_changepassword() {
            $.ligerDialog.open({ title: '修改密码', height: 300, width: 400, url: '/user/changepwd' });
        }

        $(function () {
            //菜单初始化
            $("#maintree").ligerTree({
                checkbox: false,
                url: '/module/nav?t=' + Math.random()
            });

            $("ul.menulist li").live('click', function () {
                var jitem = $(this);
                var tabid = jitem.attr("tabid");
                var url = jitem.attr("url");
                if (!url) return;
                if (!tabid) {
                    tabidcounter++;
                    tabid = "tabid" + tabidcounter;
                    jitem.attr("tabid", tabid);
                }

                f_addTab(tabid, $("span:first", jitem).html(), url);
            }).live('mouseover', function () {
                var jitem = $(this);
                jitem.addClass("over");
            }).live('mouseout', function () {
                var jitem = $(this);
                jitem.removeClass("over");
            });

            //布局初始化 
            //layout
            layout = $("#mainbody").ligerLayout({ height: '100%', heightDiff: -3, leftWidth: 200, onHeightChanged: f_heightChanged, minLeftWidth: 120 });
            var bodyHeight = $(".l-layout-center:first").height();
            //Tab
            tab = $("#framecenter").ligerTab({ height: bodyHeight, contextmenu: true });

        });
    </script>
</body>
</html>
